package com;/*
 *Author:cxz
 *@Date:${Date}
 */

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import org.junit.Test;

/*
@ClassName TTT

*@Description
*@Author cxz
*@Date 2020/4/6 19:15
*Version V1.0
*/
public class TTT {

  @Test
  public void s() {
    Connection connection = null;
    PreparedStatement preparedStatement = null;
    ResultSet resultSet = null;
    try {
      Class.forName("com.mysql.jdbc.Driver");
      connection =
          DriverManager.getConnection(
              "jdbc:mysql://47.94.194.201:36310/atf_live?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useSSL=false",
              "test",
              "test123");
      String sql = "select * from user where name= ?";
      preparedStatement = connection.prepareStatement(sql);
      preparedStatement.setString(1, "tom");
      resultSet = preparedStatement.executeQuery();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

}
